package com.liang.lamda;

/**
 * @Author:liangli
 * @Date:2020/11/17 15:22
 */
public class TestLambda2 {
    static class Love1 implements ILove{
        @Override
        public void love(int a) {
            System.out.println("i love you->"+a);
        }
    }
    public static void main(String[] args) {
        ILove love=new Love();
        love.love(1);
        love=new Love1();
        love.love(2);
        class Love3 implements ILove{
            @Override
            public void love(int a) {
                System.out.println("i love you->"+a);
            }
        }
        love =new Love3();
        love.love(3);

        love= new ILove() {
            @Override
            public void love(int a) {
                System.out.println("xinxin buainil"+a);
            }
        };
        love.love(4);

        love=(a)->{
            System.out.println("i love xinxin"+a);
        };
        love.love(5);
    }
}
interface ILove{
    void love (int a);
}

class Love implements ILove{
    @Override
    public void love(int a) {
        System.out.println("i love you->"+a);
    }
}